package com.atguigu.record;

public record Triangle(double a, double b,double c) {

    //静态变量也与普通类一样定义即可
    private static String name;

    public static String getName() {
        return name;
    }

    public static void setName(String name) {
        Triangle.name = name;
    }

    //其他方法与普通类一样定义
    public double area(){
        double p = (a+b+c)/2;
        return Math.sqrt(p*(p-b)*(p-c)*(p-a));
    }
}
